<div id="title_right">
	<p id="title_right_left"></p>
	<div id="title_right_center">
		<p class="chu_title">CHI TIẾT NHẬP HÀNG</p>
	</div>
	<p id="title_right_right"></p>
</div>
<?php if($data){
	 ?>
<form method="post" action="admin.php?mod=timchitietnhap">
	<table height="40px" width="200px" style="margin: 10px">
	<tr>
	<td><input name="ctn" type="text" ><td>
	<td><input name="tim" type="submit" value="Tìm"></td>
	</tr>
	</table>
	</form>
<table class="table">
		<tr class="mau2">
			<td>STT</td>
			<td>Nhà cung cấp</td>
			<td width="200">Mặt hàng</td>
			<td>Đơn giá nhập</td>
			<td>Số lượng nhập</td>
			<td>Ngày nhập</td>
			<td><img src="public/images/b_edit.png" /> Sửa</td>
			<td><img src="public/images/b_drop.png" /> Xóa</td>
		</tr>
		<?php 
		$i=1;
		if (is_array($data['list'])){
		foreach ($data['list'] as $key => $value) { 
		if($i%2==0){
			echo "<tr class='mau'>";
		}else
		{
			echo "<tr>";
		}
		?>
			<td><?php echo $i;?></td>
			<td><?php
			if(is_array($data['listncc'])){
				foreach ($data['listncc'] as $item){
					if($item['MaNCC'] == $value['MaNCC']){
						echo $item['TenNCC'];
					}
				}
			}
			?>
			</td>
			<td><?php 
			if(is_array($data['listmathang'])){
				foreach ($data['listmathang'] as $item){
					if($item['MaMH'] == $value['MaMH']){
						echo $item['TenMH'];
					}
				}
			}
			?>
			</td>
			<td><?php echo $value['DonGiaNhap']?></td>
			<td><?php echo $value['SoLuongNhap'];?></td>
			<td><?php echo $value['NgayNhap'];?></td>
			<td><a href="admin.php?mod=edit_ctnhap&id=<?php echo $value['MaCTN'];?>"><img src="public/images/b_edit.png" /></a></td>
			<td><a href="admin.php?mod=del_ctnhap&id=<?php echo $value['MaCTN'];?>"><img src="public/images/b_drop.png" /></a></td>
		</tr>
		<?php
		$i++;
		}   } ?>
		<tr>
		<td colspan="7">
			<button onclick="window.location.href='admin.php?mod=add_ctnhap'">Nhập thêm</button></td>
		</tr>
	</table>

<?php }?>
<?php
//Xuat phan trang 
	 echo "<p align='center'>";
	 echo "<br>";
	 echo $pagelist;
	  echo "<br>";
	   echo "<br>";
	    echo "<br>";
	 echo "</p>";
?>
